﻿<?php
require_once "common.php";
class login{
	private $username;
	private $password;
	function __construct($username,$password){
		$this->username=$username;
		$this->password=$password;
	}
	function __set($name,$val){
		$this->$name=$val;
	}
	function __get($name){
		return $this->$name;
	}
	function check(){
		$sql="SELECT * FROM user WHERE username='".$this->username."'";
		$result=mysql_query($sql);
		$array=mysql_fetch_array($result);
		if(md5($this->password)==$array[password]){
			return $array;
		}
		return false;
	}
	



}


?>